package com.oncliedisk.administrator.DB;

import android.content.Context;
import android.database.sqlite.SQLiteDatabase;
import android.database.sqlite.SQLiteOpenHelper;

/**
 * Created by Administrator on 2015/12/3.
 * 数据库帮助类
 */
public class SqliteHelper extends SQLiteOpenHelper {

    public SqliteHelper(Context context) {
        super(context, "file.db", null, 1);
    }

    @Override
    public void onCreate(SQLiteDatabase db) {
        //创建文件表
        db.execSQL("create table tb_file(_id Integer primary key autoincrement,bytes text,hash text,icon text,isDir Integer,modified text,clientMtime text,path text,root text,size text,mimeType text,md5 text,sha1 text,revision text,thumb text,rev text,thumbExists Integer,isDeleted Integer,isfirst Integer,parent_url text,filename text,downpath text,localpath text)");
        db.execSQL("create table tb_task(_id Integer primary key autoincrement,filename text,size text,progress text,state Integer,type text,path text,shl text,taskType text,date text,localPath text,currSize text)");
//        //插入5个文件夹
//        db.execSQL("insert into tb_folder(name,date,isfirst,folder_id) values('文件夹一','2015-12-09 13:50:52',1,0)");
//        db.execSQL("insert into tb_folder(name,date,isfirst,folder_id) values('文件夹二','2015-12-09 13:50:52',1,0)");
//        db.execSQL("insert into tb_folder(name,date,isfirst,folder_id) values('文件夹三','2015-12-09 13:50:52',1,0)");
//        db.execSQL("insert into tb_folder(name,date,isfirst,folder_id) values('文件夹四','2015-12-09 13:50:52',1,0)");
//        db.execSQL("insert into tb_folder(name,date,isfirst,folder_id) values('文件夹五','2015-12-09 13:50:52',1,0)");
//        db.execSQL("insert into tb_folder(name,date,isfirst,folder_id) values('文件夹六','2015-12-09 13:50:52',0,1)");
//        db.execSQL("insert into tb_folder(name,date,isfirst,folder_id) values('文件夹七','2015-12-09 13:50:52',0,1)");
//        //插入doc文档
//        db.execSQL("insert into tb_file(name,size,date,type,path,isfirst,folder_id) values('我的Word.doc','2.1M','2015-12-09 13:50:52',1,'',1,0)");
//        db.execSQL("insert into tb_file(name,size,date,type,path,isfirst,folder_id) values('我的PPT.ppt','232kb','2015-12-09 13:50:52',1,'',1,0)");
//        db.execSQL("insert into tb_file(name,size,date,type,path,isfirst,folder_id) values('我的表格.xlsx','120kb','2015-12-09 13:50:52',1,'',1,0)");
//        //插入音乐
//        db.execSQL("insert into tb_file(name,size,date,type,path,isfirst,folder_id) values('真是醉了.mp3','3.5M','2015-12-09 13:50:52',4,'',1,0)");
//        db.execSQL("insert into tb_file(name,size,date,type,path,isfirst,folder_id) values('爱情买卖.mp3','3.5M','2015-12-09 13:50:52',4,'',1,0)");
//        db.execSQL("insert into tb_file(name,size,date,type,path,isfirst,folder_id) values('爱情买卖1.mp3','3.5M','2015-12-09 13:50:52',4,'',1,0)");
//        db.execSQL("insert into tb_file(name,size,date,type,path,isfirst,folder_id) values('爱情买卖2.mp3','3.5M','2015-12-09 13:50:52',4,'',1,0)");
//        db.execSQL("insert into tb_file(name,size,date,type,path,isfirst,folder_id) values('爱情买卖3.mp3','3.5M','2015-12-09 13:50:52',4,'',1,0)");
//        db.execSQL("insert into tb_file(name,size,date,type,path,isfirst,folder_id) values('爱情买卖4.mp3','3.5M','2015-12-09 13:50:52',4,'',1,0)");
//        //插入视频
//        db.execSQL("insert into tb_file(name,size,date,type,path,isfirst,folder_id) values('泰囧1.mp4','50M','2015-12-09 13:50:52',2,'',1,0)");
//        db.execSQL("insert into tb_file(name,size,date,type,path,isfirst,folder_id) values('泰囧2.mp4','50M','2015-12-09 13:50:52',2,'',1,0)");
//        db.execSQL("insert into tb_file(name,size,date,type,path,isfirst,folder_id) values('泰囧3.mp4','50M','2015-12-09 13:50:52',2,'',1,0)");
//        db.execSQL("insert into tb_file(name,size,date,type,path,isfirst,folder_id) values('泰囧4.mp4','50M','2015-12-09 13:50:52',2,'',1,0)");
//        db.execSQL("insert into tb_file(name,size,date,type,path,isfirst,folder_id) values('泰囧5.mp4','50M','2015-12-09 13:50:52',2,'',1,0)");
//        //插入应用
//        db.execSQL("insert into tb_file(name,size,date,type,path,isfirst,folder_id) values('拳皇98.app','50M','2015-12-09 13:50:52',5,'',1,0)");
//        //插入BT种子
//        db.execSQL("insert into tb_file(name,size,date,type,path,isfirst,folder_id) values('bt.bt','10kb','20121207',3,'',1,0)");
//        db.execSQL("insert into tb_file(name,size,date,type,path,isfirst,folder_id) values('bt1.bt','10kb','20121207',3,'',1,0)");
//        db.execSQL("insert into tb_file(name,size,date,type,path,isfirst,folder_id) values('b2t.bt','10kb','20121207',3,'',1,0)");
//        //插入照片
//        db.execSQL("insert into tb_file(name,size,date,type,path,isfirst,folder_id) values('萌宠图2.png','10kb','2015-12-09 13:50:52',0,'http://v1.qzone.cc/pic/201312/07/13/38/52a2b44a25dff830.jpg%21600x600.jpg',1,0)");
//        db.execSQL("insert into tb_file(name,size,date,type,path,isfirst,folder_id) values('萌宠图2.png','10kb','2015-12-09 13:50:52',0,'http://pic.nipic.com/2007-11-08/200711819358104_2.jpg',1,0)");
//        db.execSQL("insert into tb_file(name,size,date,type,path,isfirst,folder_id) values('萌宠图2.png','10kb','2015-12-09 13:50:52',0,'http://pic.nipic.com/2007-11-08/200711819358104_2.jpg',1,0)");
//        //插入文件夹下的word
//        db.execSQL("insert into tb_file(name,size,date,type,path,isfirst,folder_id) values('第一个文件夹下的word.doc','22kb','2015-12-09 13:50:52',1,'',0,1)");
//        db.execSQL("insert into tb_file(name,size,date,type,path,isfirst,folder_id) values('第二个文件夹下的表格.xlsx','120kb','2015-12-09 13:50:52',1,'',0,2)");
//        db.execSQL("insert into tb_file(name,size,date,type,path,isfirst,folder_id) values('第三个文件夹下的表格.xlsx','120kb','2015-12-09 13:50:52',1,'',0,3)");
//        db.execSQL("insert into tb_file(name,size,date,type,path,isfirst,folder_id) values('第四个文件夹下的表格.xlsx','120kb','2015-12-09 13:50:52',1,'',0,4)");
//        db.execSQL("insert into tb_file(name,size,date,type,path,isfirst,folder_id) values('第五个文件夹下的表格.xlsx','120kb','2015-12-09 13:50:52',1,'',0,5)");
    }

    @Override
    public void onUpgrade(SQLiteDatabase db, int oldVersion, int newVersion) {

    }
}
